home *** CD-ROM | disk | FTP | other *** search
/ Tech Arsenal 1 / Tech Arsenal (Arsenal Computer).ISO / tek-04 / bipl.zip / PROGS.ZIP / DIFFWORD.ICN < prev    next >
Text File  |  1992-09-28  |  728b  |  28 lines

  1. ############################################################################
  2. #
  3. #    File:     diffword.icn
  4. #
  5. #    Subject:  Program to list different words
  6. #
  7. #    Author:   Ralph E. Griswold
  8. #
  9. #    Date:     May 9, 1989
  10. #
  11. ###########################################################################
  12. #
  13. #  This program lists all the different words in the input text.
  14. #  The definition of a "word" is naive.
  15. #
  16. ############################################################################
  17.  
  18. procedure main()
  19.    local letter, words, text
  20.  
  21.    letter := &letters
  22.    words := set()
  23.    while text := read() do
  24.       text ? while tab(upto(letter)) do
  25.          insert(words,tab(many(letter)))
  26.    every write(!sort(words))
  27. end
  28.